﻿@model SiteTemplateUpdateModel

@using Carrotware.CMS.Mvc.UI.Admin.Models

@{
	ViewBag.Title = "Site-Wide Template Update";
}

@using (Html.BeginForm()) {
	@Html.AntiForgeryToken()

	<fieldset style="width: 500px;">
		<legend>
			<label>
				Content
			</label>
		</legend>
		<p>
			<b>Home Page</b>&nbsp;&nbsp;&nbsp;&nbsp;
			@String.Format("{0}  [{1}] ", Model.HomePageTitle, Model.HomePageLink)
			<br />
			@Html.DropDownListFor(model => Model.HomePage, new SelectList(Model.SiteTemplateList, "TemplatePath", "Caption"), "[Select Template]")
			<br />
		</p>
		<p>
			<b>All Content Pages (only)</b>
			<br />
			@Html.DropDownListFor(model => Model.AllPages, new SelectList(Model.SiteTemplateList, "TemplatePath", "Caption"), "[Select Template]")
			<br />
		</p>
		<p>
			<b>All Top Level Pages (only)</b>
			<br />
			@Html.DropDownListFor(model => Model.TopPages, new SelectList(Model.SiteTemplateList, "TemplatePath", "Caption"), "[Select Template]")
			<br />
		</p>
		<p>
			<b>All Sub Level Pages (only)</b>
			<br />
			@Html.DropDownListFor(model => Model.SubPages, new SelectList(Model.SiteTemplateList, "TemplatePath", "Caption"), "[Select Template]")
			<br />
		</p>
	</fieldset>
	<fieldset style="width: 500px;">
		<legend>
			<label>
				Blog
			</label>
		</legend>
		<p>
			<b>Index Page</b>
			<br />
			<div style="clear: both; display: block; min-height: 4px;">
				<!-- parent page plugin-->
				@{
	var drill = new SitePageDrillDownModel {
		FieldName = Html.NameFor(m => m.IndexPageID).ToString(),
		CurrentPageID = Guid.Empty,
		SelectedPageID = Model.IndexPageID
	};
				}

				@Html.Partial("_SitePageDrillDown", drill)
			</div>
			<div style="clear: both; display: block; ">
				<br />
				@Html.DropDownListFor(model => Model.IndexPage, new SelectList(Model.SiteTemplateList, "TemplatePath", "Caption"), "[Select Template]")
				<br />
			</div>
		</p>
		<p>
			<b>All Blog Posts (only)</b>
			<br />
			@Html.DropDownListFor(model => Model.BlogPages, new SelectList(Model.SiteTemplateList, "TemplatePath", "Caption"), "[Select Template]")
			<br />
		</p>
	</fieldset>
	<fieldset style="width: 500px;">
		<legend>
			<label>
				Everything (including home and blog index)
			</label>
		</legend>
		<p>
			<b>All Content (Content Pages and Blog Posts)</b>
			<br />
			@Html.DropDownListFor(model => Model.AllContent, new SelectList(Model.SiteTemplateList, "TemplatePath", "Caption"), "[Select Template]")
			<br />
		</p>
	</fieldset>
	<p>
		<br />
	</p>
	<p>
		<input type="submit" name="btnSave" value="Save" id="btnSave" />
	</p>

}

@*@using (Html.BeginForm())
	{
		@Html.AntiForgeryToken()

		<div class="form-horizontal">
			@Html.ValidationSummary(true, "", new { @class = "text-danger" })
			<div class="form-group">
				@Html.LabelFor(model => model.HomePage, htmlAttributes: new { @class = "control-label col-md-2" })
				<div class="col-md-10">
					@Html.EditorFor(model => model.HomePage, new { htmlAttributes = new { @class = "form-control" } })
					@Html.ValidationMessageFor(model => model.HomePage, "", new { @class = "text-danger" })
				</div>
			</div>

			<div class="form-group">
				@Html.LabelFor(model => model.AllContent, htmlAttributes: new { @class = "control-label col-md-2" })
				<div class="col-md-10">
					@Html.EditorFor(model => model.AllContent, new { htmlAttributes = new { @class = "form-control" } })
					@Html.ValidationMessageFor(model => model.AllContent, "", new { @class = "text-danger" })
				</div>
			</div>

			<div class="form-group">
				@Html.LabelFor(model => model.TopPages, htmlAttributes: new { @class = "control-label col-md-2" })
				<div class="col-md-10">
					@Html.EditorFor(model => model.TopPages, new { htmlAttributes = new { @class = "form-control" } })
					@Html.ValidationMessageFor(model => model.TopPages, "", new { @class = "text-danger" })
				</div>
			</div>

			<div class="form-group">
				@Html.LabelFor(model => model.SubPages, htmlAttributes: new { @class = "control-label col-md-2" })
				<div class="col-md-10">
					@Html.EditorFor(model => model.SubPages, new { htmlAttributes = new { @class = "form-control" } })
					@Html.ValidationMessageFor(model => model.SubPages, "", new { @class = "text-danger" })
				</div>
			</div>

			<div class="form-group">
				@Html.LabelFor(model => model.IndexPageID, htmlAttributes: new { @class = "control-label col-md-2" })
				<div class="col-md-10">
					@Html.EditorFor(model => model.IndexPageID, new { htmlAttributes = new { @class = "form-control" } })
					@Html.ValidationMessageFor(model => model.IndexPageID, "", new { @class = "text-danger" })
				</div>
			</div>

			<div class="form-group">
				@Html.LabelFor(model => model.IndexPage, htmlAttributes: new { @class = "control-label col-md-2" })
				<div class="col-md-10">
					@Html.EditorFor(model => model.IndexPage, new { htmlAttributes = new { @class = "form-control" } })
					@Html.ValidationMessageFor(model => model.IndexPage, "", new { @class = "text-danger" })
				</div>
			</div>

			<div class="form-group">
				@Html.LabelFor(model => model.BlogPages, htmlAttributes: new { @class = "control-label col-md-2" })
				<div class="col-md-10">
					@Html.EditorFor(model => model.BlogPages, new { htmlAttributes = new { @class = "form-control" } })
					@Html.ValidationMessageFor(model => model.BlogPages, "", new { @class = "text-danger" })
				</div>
			</div>

			<div class="form-group">
				@Html.LabelFor(model => model.AllPages, htmlAttributes: new { @class = "control-label col-md-2" })
				<div class="col-md-10">
					@Html.EditorFor(model => model.AllPages, new { htmlAttributes = new { @class = "form-control" } })
					@Html.ValidationMessageFor(model => model.AllPages, "", new { @class = "text-danger" })
				</div>
			</div>

			<div class="form-group">
				<div class="col-md-offset-2 col-md-10">
					<input type="submit" value="Save" class="btn btn-default" />
				</div>
			</div>
		</div>
	}

	<div>
		@Html.ActionLink("Back to List", "Index")
	</div>*@